<template>
  <div class="error">
    <div class="content inner">
      <div class="error-wrap">
        <img src="../assets/images/bg-error.png" alt="" />
        <span>{{ statusCode }}</span>
        <div class="error-text">
          <p>啊哦，出错了...</p>
          <el-button @click="goLogin">返回登录页</el-button>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import { getSysPara } from "../utils/api";
export default {
  name: "Error",
  data() {
    return {
      statusCode: "404",
    };
  },
  methods: {
    async getSysName(type) {
      try {
        const data = await getSysPara(type);
        if (data.res == 0) {
          this.$store.dispatch("setWpzswTitle", data.data[0].value);
        } else {
          this.$message.error(data.msg);
        }
      } catch (error) {}
    },
    goLogin() {
      this.$router.push("/zmkm");
    },
  },
  computed: {
    wpzswTitle() {
      return this.$store.state.wpzswTitle;
    },
  },
  created() {
    this.getSysName("SysName");
    if (this.$route.query.statusCode) {
      this.statusCode = this.$route.query.statusCode;
    } else {
      this.statusCode = "404";
    }
  },
};
</script>
<style lang="scss" scoped>
.error {
  min-height: 90vh;
  padding-top: 150px;
  .error-wrap {
    width: 100%;
    text-align: center;
    position: relative;
    span {
      position: absolute;
      top: 415px;
      left: 50%;
      transform: translateX(-50%);
      font-style: italic;
      color: #a7cbff;
      font-size: 16px;
    }
    .error-text {
      margin-top: -90px;
      p {
        margin-bottom: 39px;
        color: #666;
        font-size: 16px;
      }
      .el-button {
        font-size: 16px;
        padding: 0 20px;
        height: 36px;
      }
    }
  }
}
</style>